package ca.usherbrooke.builder.equipment;

import java.io.FileNotFoundException;
import java.io.IOException;

import ca.usherbrooke.view.properties.PropertieBase;

public class ProtectionModelObjectBuilder {

	// name keys
	private final static String LOCATION_TYPE = "protection_model_location_type_key";
	private final static String BONUS_DEFENSE = "protection_model_bonus_defense_key";

	public static ProtectionModelObject createProtectionObject(String fileName)
			throws FileNotFoundException, IOException {

		System.out.println("build protection");
		PropertieBase properties = new PropertieBase(fileName);

		ProtectionModelObject equipmentObject = new ProtectionModelObject();

		EquipmentModelObjectBuilder.fillEquipmentObject(properties,
				equipmentObject);

		equipmentObject.locationType = properties
				.getIntegerValue(ProtectionModelObjectBuilder.LOCATION_TYPE);
		equipmentObject.bonusDefense = properties
				.getIntegerValue(ProtectionModelObjectBuilder.BONUS_DEFENSE);

		return equipmentObject;
	}
}
